package com.turing.procedure.model.domain.task;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.turing.common.entity.Context;
import com.turing.common.util.Tools;
import com.turing.orm.model.domain.common.BaseDo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * @Description
 * @Author lcy
 * @Date 2021-05-25
 */
@ApiModel(value = "")
@Data
@EqualsAndHashCode(callSuper = false)
@Builder(toBuilder = true)
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class TaskRecord extends BaseDo<TaskRecord> {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("task_name")
    private String taskName;

    @TableField("child_tasks")
    private String childTasks;

    @TableField("task_sn")
    private String taskSn;

    @TableField("child_task_sns")
    private String childTaskSns;

    @TableField("file_path")
    private String filePath;

    @TableField("template_id")
    private String templateId;

    @TableField("template_name")
    private String templateName;

    @TableField("template_group")
    private Integer templateGroup;

    @ApiModelProperty(value = "0待抽取 1预抽取 2抽取中 4待初审 5待终审 6已审核")
    @TableField("status")
    private Integer status;

    @TableField("upload_time")
    private Date uploadTime;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    @TableField("created_by")
    private Integer createdBy;

    @ApiModelProperty(value = "创建人名称")
    @TableField("created_by_name")
    private String createdByName;

    @TableField("created_by_role")
    private Integer createdByRole;

    @TableField("updated_by")
    private String updatedBy;

    @TableField("reviewer")
    private Integer reviewer;

    @TableField("reviewer_name")
    private String reviewerName;

    @TableField("review_time")
    private Date reviewTime;

    /**
     * 是否需要推送rpa
     */
    @TableField("need_rpa")
    private Integer needRpa;

    /**
     * rpa推送状态
     */
    @TableField("rpa_status")
    private Integer rpaStatus;

    @TableField("rpa_task_id")
    private Long rpaTaskId;

    @TableField("rpa_message")
    private String rpaMessage;

    @TableField("error_message")
    private String errorMessage;

    @Override
    protected Serializable pkVal(){
        return this.id;
    }
}

